package longshu.data.domain;


import lombok.experimental.Accessors;
import longshu.data.common.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * Province 省
 *
 * @author LongShu
 * @since 2018-02-01
 */
@lombok.Getter
@lombok.Setter
@Accessors(chain = true)
@Table(name = "province")
public class Province extends BaseEntity {
    private static final long serialVersionUID = 1L;

    public Province() {
    }

    public Province(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * 省编码 (行政区划代码)
     */
    @Column(name = "code", unique = true, nullable = false)
    private Integer code;

    /**
     * 省名称
     */
    @Column(name = "name", unique = true, nullable = false, length = 16)
    private String name;

    @Override
    public String toString() {
        return code + "," + name;
    }

}